from django.urls import re_path, path
from spit import views

urlpatterns = [
    # 发布吐槽 吐槽列表
    path('spit/', views.SpitCreateView.as_view()),

    # path('spit/', views.SpitViewSet.as_view({
    #     'get': 'list'
    # })),

    # 获取吐槽详情
    # re_path(r'^spit/(?P<pk>\d+)/$', views.SpitDetailViewSet.as_view({
    #     'get': 'retrieve'
    # })),
    re_path(r'^spit/(?P<pk>\d+)/$', views.SpitDetailView.as_view()),

    # 获取吐槽评论
    # re_path(r'^spit/(?P<pk>\d+)/children/$', views.SpitCommentViewSet.as_view({
    #     'get': 'retrieve'
    # })),
    re_path(r'^spit/(?P<pk>\d+)/children/$', views.SpitCommentView.as_view()),

    # 收藏和取消收藏
    re_path(r'^spit/(?P<pk>\d+)/collect/$', views.SpitCollect.as_view()),

    # 点赞或者取消点赞
    re_path(r'^spit/(?P<pk>\d+)/updatethumbup/$', views.UpdateThumbUp.as_view()),

]
